package cn.edu.scnu.semart.order.feign;
import cn.edu.scnu.semart.model.goods.Goods;
import io.swagger.models.auth.In;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(name = "service-goods", path = "/goods")
public interface GoodsFeignClient {
    @PostMapping("/batch")
    List<Goods> getBatchByIds(@RequestBody List<Integer> ids);

    @PostMapping("/deduct-stock")
    Boolean deductStock(@RequestBody Map<Integer, Integer> deductMap);

    @PostMapping("/restore-stock")
    Boolean restoreStock(@RequestBody Map<Integer, Integer> restoreMap);
}
